home *** CD-ROM | disk | FTP | other *** search
- Path: peer-news.britain.eu.net!warwick!kinguni!k930459
- From: k930459@kingston.ac.uk (Mark Sukhija)
- Newsgroups: comp.lang.c
- Subject: Re: Question on argv
- Date: 16 Feb 1996 12:30:42 GMT
- Organization: Kingston University, Kingston-upon-Thames.
- Message-ID: <4g1tdi$6j6@mercury.kingston.ac.uk>
- References: <4eoq3c$45j@usenet.ucs.indiana.edu> <harmon.823153381@pegasus.montclair.edu> <TANMOY.96Feb10160209@qcd.lanl.gov>
- NNTP-Posting-Host: ceres.king.ac.uk
- X-Newsreader: TIN [version 1.2 PL2]
-
- Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
- : In article <harmon.823153381@pegasus.montclair.edu>
- : harmon@pegasus.montclair.edu (Derek Harmon) writes:
- : <snip: I didn't read the rest: so do not know what is being attempted here>
-
- : #ifdef BIG_ENDIAN
- : argv[0] = hiBYTE(i);
- : argv[1] = loBYTE(i);
- : #else
- : argv[0] = loBYTE(i);
- : argv[1] = hiBYTE(i);
- : #endif
- :
- : /* when printing, typecast argv[4] as a (int *). any reference to it */
- : /* as a string hereafter will be erroneous and possibly (if < 10) fatal */
- :
- : printf("argv[4] = %d\n", (int *)argv[4]);
-
- %d expects an integer not an (int*) What you should do here is:
-
- printf("argv[4] = %d\n", atoi(argv[4]));
-
- Nothing guarentees that argv can actually be modified.
- --
- Mark Sukhija
- k930459@ceres.king.ac.uk
- Work is the curse of the drinking classes.
-
-